fixed error in shutdown() and unload event listener