updated scan code