Testing the destroy function