fix hide race condition