Fixes occasional error when first run