added sorting to grid view