Check if directory exists rather than file