added check to see if json data is empty, if it is, do nothing