method to register the hooks
registering the hooks