Made setDestroyed(bool) function