Bugfix for scan