fixed a wrong condition