* commit '2534c16b44922e19e040a999cd99b412674e63a1': Change order of operations so flag is not overwritten