fix the judgement condition