fix bug on js