improved error outputting