Wrong place to sprintf