add groups, fix event bug