Bugfix, avoid updating the same sample multiple times