Updated so the viewBarrier is used properly now