better exception handling on registration