fix bugs on Controller