Added threading to unfreeze gtk main iteration