Issue #4: ReferenceError: error is not defined