Error handling for registration