switched sessions to database