implemented asprintf helper