add logging and clean up abandoned files