Added segment control with onSegment function to change background color