Creating destroy function.