add join leave functionality