Condition doesn't show the correct value