adding hook to populate environment variables.