mainControl adapted to set and added test case