fixed bugs of controller