fixed incorrect flag reference
more idiomatic