update code so it works again