moving db initialization in method get_db

@girijabrahme : please take a look