added registration logic