fixed some bugs with the new invitation system.