fixed error check using the wrong error value

errorOut was using the err from the previous test.