sort groups controller and view page