Currently, the first 'itemDone' handler (line 61) _should_ be executed before this one, but this is not guaranteed, since these calls are asynchronous. You should move the second translation (i.e. this one) to a different function and call it from the first handler after it is done.