Error handling in the registation