fix logics