make errro handling via exception