fixed invitation handling