change group joining to be based on code