on click event works in controller