sort only if sortkey exists

seems to have problem with some version of angular