Bug fix on destroy and update