Error in controller constructor