state destroy function added