add registration logic