fix bug for undefined variable in removeFile()