added check_client_data_and_save() to DRY up the code