use usleep instead of msleep