tested and fixed on js binding