fix ctx.ip

need tests for this