ReferenceError: model is not defined