Updated example and fixed variable name mismatch