fix bug related to ordering of invitation removal