Fix removing file from loop variable