hook in controller