Fixed a bug
Fixed an annoying race condition using React hooks!