verbose log and defensive code