Added checks for nil data to the displayData function in spawn