Write isAttending function