trying to fix scope problem with js module