Destroy function implemented