js improves and fixes