fix cancel while scanning