Still working to fix threading problem