adjusted to also include test for necessary environment variables