fix handout js logic