Update to safely handle environment variable.