fix bug in model