adding the cleanup routines