add try catch to dir deletion