add registration, fixes #2