add unload function to body