Updated to make sure that the ret_value is correct

checks that the ret_value contains the value for the corresponding key.