Fix for IOException: The directory is not empty