added cout message to analyze memory leak