Fix the example code so it functions properly