added mode setting