fixed mongo connection bug