I thinkg it would be better to sort records using database