fixed bug with confidence flag