Change sprintf and delete useless check