error handling for mongoose connection