added flag byte into secure message