implement exception system
replace major error point to use exception