Added getCloseButton functionality

getCloseButton.
Changed index to use the close button.