implemented sessions correctly