adding mode toggle