update the mode