Fix for directory check (fs sync method)