Fix lag detection