Close window after handling action. Remove echo statements.