use proper syntax to determine if the path array contains a directory