Use nprintf instead direct appending