Alternative fix

I'm not sure if this is any better, I know some problems with the other way, but I could see some with this too. I really ought to use asynchronous events more.