(bug) Trying to use "flags" hash in the wrong scope