implemente the checkbutton toggled