Fix bug when checkbox didn't changed the state