register works again after refactor