added sorting to list and listEntity