Added some checks to make sure the data being returned is valid