Updated exception from IOException to generic Exception