improved String checking