Added support for capturing output