fixed the model bug