fix a bug in controller