fixed some problems with early file-delete by moving the cleanup to the close-callback of the applet