fixed team invite functionality