move flag to init