some bugs in model fixed