Add threading to scanner