trying to fix threading but sigh i give up for now