prevent double flash