add session management logic