make #401 work in js