replace sprintf with printf