changed threading and entities