trying to fix threading issue