Fixed error validating the "code" variable

Fixed error when you set the "code" variable as an array throws "InvalidArgumentException" because it's used as the error handler