[fix] group code was being generated even when joining group due to incorrect arguments in addGroup function