build error fix and logging enhancement