Fixing javascript bug for #15