Started to add directory check