countSessions method added