bug fixed and ready for grouping