Added debug lines to track calls