Bug fix

Added exception handling for setup_io()