re implemented flag changes