add some logics