fixed a bug in models