fixing printf bug