added flag to keep temp files