Pygame Snake, Check Collision not fast enough

I am having a problem where the code I am using to check for collision I assume(?) is not fast enough, when the snake gets longer, to detect that the snake has crossed its own path. If I run the code and collide early enough, it catches it. But once the snake gets large it does not. Is there any other way to check for a collision?

import pygame

from Apple import Apple


def update_length(_length):
    myfont = pygame.font.SysFont('Times New Roman', 30)
    textsurface = myfont.render('Length: ' + str(_length), True, (100, 0, 0))
    screen.blit(textsurface, (0, 0))


def drawsnake(snake_list):
    for x in snake_list:
        pygame.draw.rect(screen, (0, 255, 0), (x[0], x[1], 20, 20))


pygame.init()
SCREENWIDTH = 1000
SCREENHEIGHT = 800
screen = pygame.display.set_mode((SCREENWIDTH, SCREENHEIGHT))
condition = True
playerready = False
while condition:
    if not playerready:
        myfont = pygame.font.SysFont('Times New Roman', 30)
        textsurface = myfont.render('Click Space to Play!', True, (100, 0, 0))
        screen.blit(textsurface, (500, 400))
        pygame.display.update()
        pygame.event.clear()
        while True:
            event = pygame.event.wait()
            if event.type == pygame.QUIT:
                game_over = True
                condition = False
                break
            elif event.type == pygame.KEYDOWN:
                if event.key == pygame.K_SPACE:
                    playerready = True
                    break
    if playerready:
        body = []
        apple = Apple(screen, body)
        length = 1
        update_length(length)

        game_over = False
        x1 = 500
        y1 = 400

        x1_change = 0
        y1_change = 0

        clock = pygame.time.Clock()

        while not game_over:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    game_over = True
                    playerready = False
                    condition = False
                    break
                if event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_LEFT:
                        x1_change = -20
                        y1_change = 0
                    elif event.key == pygame.K_RIGHT:
                        x1_change = 20
                        y1_change = 0
                    elif event.key == pygame.K_UP:
                        y1_change = -20
                        x1_change = 0
                    elif event.key == pygame.K_DOWN:
                        y1_change = 20
                        x1_change = 0
            x1 += x1_change
            y1 += y1_change
            head = [x1, y1]
            body.append(head)

            if len(body) > length:
                del (body[0])
            if x1 >= SCREENWIDTH or x1 < 0 or y1 >= SCREENHEIGHT or y1 < 0:
                game_over = True
                playerready= False

            if body[0] in body[1:]: #problem here
                    print(body)
                    print(body[0])
                    game_over = True
                    playerready = False

            if x1 == apple.get_x() and y1 == apple.get_y():
                screen.fill((0, 0, 0))
                apple = Apple(screen, body)
                length = length + 4

            screen.fill((0, 0, 0))
            apple.draw()
            drawsnake(body)
            update_length(length)
            pygame.display.update()
            clock.tick(15)
pygame.display.quit()