add two threshold