fixed a small logics error