fix critical bug with folder deletion