Fixed: "ReferenceError: error is not defined"

Fixed a wrong variable name 'error'.