check for env variable first