ternary results switched when parsing url