created conditional if else in getData function to alert if there is not any data stored locally