non blocking thread version