Fix invalid use of variable in membership API