more tweaks to get the scanner to work properly