Added debugging to registration