add log and test cases