vector value cleared in select algorithm