added flush to a printf command