tweak spell-checker function