fixed a bug which prevents registeration