fixed bug in model