Fix when model is undefined