resolves issue 20

See the commit log, it's basically one fix in the js.