cleaner with error checking