debug register function