added sorting for generated columns