Slight change in database functions with session management.