js validations and UX improvement