Added test for flag attaching