close scanner after tab clicked