Fix bug with registration