fix coffee race condition