code for try_and_change_sliding_door_state