make mongodb database name configurable and keep db connected