Fixed a potential bug on user disconnect