script will now check if the date provided is returning good data; if not, yesterday date is taken; this loop is continued untill good data is returned