Properly destroying the applets when exiting