Fix for event register in previous hook