exception handing for #5 and #82