added some unit test, update activatelog function