create and join group logic