Cleaning mongo.exit logic