fixed bug with model