close popup window after actions or on discard button