fixed bug in models