fixed missing flag assignment