Moved the close in a different method that buttonClick