supporting control mode using flag