added possibility to destroy an object