fix bug with destroy.