fixed js function call