fixed printf bug