fixed an issue with rename() and a bunch of uncleaned temp files