fix typo in legacy.js