added mode switch