fix a registration bug: existing user cannot register