fixed issue with multiple threshold values