Fix poem JS bug

Fix issue #1