fixed an issue with error handling in 'rmdirRecursive'