Background Tasks working

Switched references so background tasks work. However, there is now
duplicated coded.