You have a bracket mismatch in the on invite event and the else statement is on the outside of the alias invited.