Some changes in js handling