checking for empty data set before rendering