added checking whether a door is open or not, also made all calls blocking. removed some unneeded print statements