Fix bug where using the X button to close the prep tool would not execut...

...e cleanup routine

Resolves issue #9 

@burtonjb Pls review thx