adding additional error checking for startup