add some logging and functional fixup

Change-Id: I4d7ac493d299186112f9b6d213ae1f09d1ddb068