Make check for apostrophe faster