Fixed defect when try to scan after tab switching