Added debug log function