check for existence of unload event before binding