Removed a bug when register a user