Task creation working for the most part but struggling with strange subquery bug