fixed bug in controller;