Why do I have to input once before my door opens?

Here is the video with the code: - YouTube