added on error handling onto registration