fixed can not call resolve on an undefined value bug
added expected_sample_from_metadata_key option so that expected_sample can be taken from individual if necessary