Fix bug with toggle state