ok use

flags2 = VISIBLE;

instead of

flags = visible;