added an onDeath method for handling proer disposal of assets