Correct checking for valid Mongo connection for sessions