added detect for fail to connect to monogodb server