ps2 barcode scanner using instantly

I am using u8glib libraly with one 128x64 graphic lcd. This libraly working like this code in the loop()

void loop(void) {
  // picture loop
  u8g.firstPage();  
  do {
    draw();
  } while( u8g.nextPage() );
  
  // rebuild the picture after some delay
  delay(100);

//run barcode scanner 
if(number==5)
{
checkBarcode();
checked=true;
}

}

void draw(void) {
  // graphic commands to redraw the complete screen should be placed here  
  u8g.setFont(u8g_font_unifont);
  u8g.drawStr( 0, 20, "Hello World!");
//if barcode scanner had checked write ok.
  if(checked)
  u8g.drawStr( 0, 40, "ok checked");
}
.
.
.

In my setup, screen freezing when number=5