Fixed bug with the destroy method