Your logic in the condition is wrong.