updated get_task_windows function