Add debug statements for state change