fixed distorted image when threads are not done