Corrected code for removing files