why the last condition is not satisfying ??