Adding better check for env variables