bug in invitation changes, and better logout handling