fixed invalid condition