Added capturing the console output.