Fixed register function