Great that you find this problem and fixed it. It is logical error, and sometimes hard to find logical things in code!