I have a bar code gun, when i scan a bar code it will run the below function, but when I scan 5-6 bar code too fast it will give duplicate data

Also I need async to be true, or else it would be slow
Is there a way to do fix that so i don't have duplicate data?

```
function getUnReadBox() { 

$("#unReadBoxList").children().remove('li') ; 

$.ajax({ 
        dataType: "json",
        url: xxxx.php ,     
        success: saveUnRead , 
        error: function ( xhr , b , c ) { 
            $("#reportMsg").html ( "error" ) ;  },
        async: true }); 

}

function saveUnRead ( json ) { 

var i ; 
var new_item ; 
var msg ; 

for ( i in json ) { 
    new_item = '<li>' + json[i].PACKAGE_ID + "</li>" ; 
    $("#unReadBoxList").append ( new_item ) ; 
    scShipping.unReadBox ++ ; 

    $("#unReadBox").html ( msg ) ; 
}
$("#unReadBoxList").listview('refresh') ;
}

```

Edit

I added

```
$("#unReadBoxList").children().remove('li') ; 
 var d = new Date();
 var num = d.getTime();

var mySQL = scShipping.jsonUrl+'scTripUnRead.php?T='+scShipping.tripId+"&O="+scShipping.whichOp+"?date="+num ; 

$.ajax({ 
        dataType: "json",
        url: mySQL ,     
        success: saveUnRead , 
        error: function ( xhr , b , c ) { 
            $("#reportMsg").html ( "error" ) ;  },
        async: true }); 

}

```

but I still get duplicated data