Add join and leave functions