fixed the deletion error on os x, now looking at chdir error