fixed sorting by id