Fixed window close for background process