[err] adding additional error handling