debug and Write the new case