Safer threading with file manager