added some data validation to javascript iterated client when writing a sample to a chain.