Appeals court to hear challenge to gay therapy ban