fix code so it works