adding code for controller