Trying to support event on unload