Fixing flags not adding bug