fixing sort z indexes