added some comments and added support for warning when a hook is already set