firing error if user closes window before task id is received