Added hooks and environment variables