updated JS bugs