Fixed mongodb connection issues