updated operate_door() functionality.