many various changes to magically fix the freezing issue