added cleanup to a script