fixed an emr bug: scanner has limited buffer