Fix redirect on invalid XID