Updated error handling methods

Updated error handling methods