flag updates (thx to frodo)