Changed where mongoose connection occurs to be not in the model