handle exceptions in io. this should not have taken this long