pass context around to prevent race condition