make close buttons work