Improve search js validations