proper printing for errors