Code optimization ; add close button