Invitation logic updated