removeFile bug fix and polishing