added destoy function
bug fixes