remove character and position from error message