fixed: "local variable 'referral_form' referenced before assignment" in referral form