now removes temp files properly