Making popup window close after insert