Added a check to see if the door is closed before the lock in engaged