add error checking in data gatherer