fixed bug in model controller