Using d[0] instead of d.length (Use the first value if it exists)