changed hardcoded db name to use session var