fixed race condition, but there is brush bug