Add loop and close button