Should fix the freezing bug, might break other stuff.