sorting and pagination added