Added logic for sleeping state.