Fix strange ui freeze on macosx

It took quite a while for just a line of code :)