fixing javascript wrapper bug