We can use event to read console output instead of thread