Im creating a game.How do I change different background images? When I try it just displays for like .5 sec. Please help me : This is my code to a new background and objects.

    def bathRoom():
    global drag, a, b, c, d, e, f, g, h, i, j
    bg_bathroom = True
    bathroom = pygame.image.load("pou_bathroom.jpg")
    mouse = pygame.mouse.get_pos()
    click = pygame.mouse.get_pressed()
    gameDisplay.blit(bathroom,[0,0])
    gameDisplay.blit(pivi,[200,80])
    gameDisplay.blit(soap,(a, b))
    gameDisplay.blit(shower,(c,d))
    gameDisplay.blit(shop,(e,f))

    
    if click[0] == 1 and a + soapWidth > mouse[0] > a and b + soapHeight >                             mouse[1] > b:
        drag == 1      
        a = mouse[0] - (soapWidth / 2)   
        b = mouse[1] - (soapHeight / 2)

    
    if click[0] == 1 and c + showerWidth > mouse[0] > c and d + showerHeight > mouse[1] > d: 
        drag == 1
        c = mouse[0] - (showerWidth / 2)
        d = mouse[1] - (showerHeight / 2)


    def main_loop():
        while True:        
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                   pygame.quit()
                   quit()
        
            mainScreen()
            mouse = pygame.mouse.get_pos()
            click = pygame.mouse.get_pressed()
        
            if click[0] == 1 and x + bathWidth > mouse[0] > x and y + bathHeight > mouse[1] > y: 
            bathRoom()
            pygame.display.update()

This is the part that I try to change background
After I click the image I need to display a new background but it just displays for .5sec I need it to stay then I will be the one to change it again
      
           main_loop()
           pygame.quit()
           quit()
