switched id to group little error checking and cleanup