fixed bug in removeAllFiles