updated sessions code