mongo connection error handling