reworked flow for pin first then scan