trying to make threading work :(
merged fix