added error checking for all the generators