Fixing undefined [0][0] in buildUrl