fix nullpointer exception in visualizing results