add confidence checking