handle code redemption