replace vsprintf call with sprintf