removed substring function on error messages