correct register function