more js validations and some fixes
merge conflicts with master