fixing js error (issue #127)