Added waitForTransform to avoid race condition