correctly handle registration