added check for env key