propose to move getSessionId from createTaskPlots() to getDataSource()

Now you are getting sessionId and using it in two independent functions createTaskPlots() and getParentId().