started validation function