fix too broad exception handling