return an error object instead of a string as an error