Added check to prevent multiple users with the same username from being created in the database.