Bug fixes, add destroy function 3