Could someone tell me where is the mistake with last condition?