Fixing registered handlers storage memleak