fix barcode scanning and restoring search field state