added some logics