add native mode option
fix 'exists' typo
add empty directory check