Fix error when redirecting after inviting a friend