fixing the complete sorting link in the controller