fix for directory check