One time the condition is working, other time is not