check if dirs are empty befory deleting them