Fix queued tasks being undefined