use asprintf instead of sprintf