threshold fix and more logging