added error checking to getenv and created test script