fixed bug in toogleButtonClickEvent