i think end should only be used when there is a need for immediate termination of the program. otherwise use unload to perform some clean-up tasks in the unload and terminate events.