close popup when calling destroy