Added check for duplicate user name when registering