added sorting for wrong values