fixed a bug in the model