fix the join public event code