adding mode selector