started doing the error handling