fix small bugs in controller