added an init() function to the controller