check for valid data