Adding db sessions to tasks