validation and ajax call