Added exception handling to changed solver