Add directory check.