Add conditions checking for records