Fixed the mode setter