Fixed JS poem looping bug

Fixed Issue #2