added code to run the hook