Added some checks of data before showing it in the graph