fixxed several model bugs