Fixing the string function