Added debug logic.