sort only if sortkey exists

seems to have problem with some version of angular (i.e. 1.2.26)