added flagging feature