added synchronized to the do in background