fixed issues with process not terminating on window close