added window.close after each action