optimized runonce