Fixed capturing error message
Added print data test