fix to make scanning much faster