Added error handling to mongoose config/setup