Fix broken invitation functionality