fixed sorting bug in output_index