printing errors the right way