fix threshold when learning