Added some console logging too to make sure that the error messages aren't getting overwritten before they can be read.