fix for JS (arrays have no length just after init)