fixed selectgroup in getFinal function