Updated to use APP_ENV if available