[fix] rmtree only if the path exists