join/close/leave functionality refactored and working fine