addClass hasClass problem

addClass hasClass problem

Hi all

Im using this code.

if(  $("#personalpoints").hasClass("completeajax")){ 
console.log("1"); 
}
else{
$("#personalpoints").addClass("completeajax");
 console.log( "2")); 
}

Console is printing 2 1 2

Im using it within a ajaxcomplete function.

Why is there a second 2, shouldnt it be impossible