added optional error messages