added test code for controller