add create group logic and fix some issues