fix issue with refresh event race condition