fixing registration bug