completed insert code for background task
background task should be within a transaction just in case.