add log and fix problem