fix windows function problems
fix windows function problems
Add stream for log file