small changes to scan_ return value