move scan function to home view