CORE-4000: fixed a problem with folder and file deletion