some state swiching in controller added