debugging scan button error