The last condition is not right. Please help me to find the problem.