fixes error when removing old file