when we move away from component it still fire onChange event, due to which i am not able to maintain the selected checkboxes.