fix bug in js escaping