added flush to log output