fixed javascript error on pages without a scanner