Fixed a bug in the after_hooks related to the callbacks