Fix #253 for js