Fixed Threading problem