Fix BY race condition