fixed destruction and syntax errors