Bug fix in model controller