fix bug in javascript-backend