added correct gui handling on toggle button