fixed all model and controller. refactor view