added check for destroy method