Fix mongodb connection