make sure toggle is boolean