Do directory check only if path exists