small change to the scan function. it works now