moving scanner from a function called from device ready to device ready