Fixed bug that caused destroy error.