Added registration logic