private void checkSessionState(UserSession session) {
        if (session.getStatus().equals(AccountServiceMessages.AUTHORIZED) || session.getStatus().equals(AccountServiceMessages.USER_ADDED)) {
            session.stopWaiting();
        }
        if (session.elapsedTime() > UserSession.MAX_WAITING) {
            session.setStatus(ExceptionMessages.SQL_ERROR);
            session.stopWaiting();
        }
    }