fixing uninstall hook since closures cant be serialized