fixed race condition bug, made a new bug