Added waiting mechanism for server to transition out of pending mode.