Make the close buttons functional