Access env only if present
Validate env input