fix a bug in model