fixed js branching issue
fixed #288