Fix threading problem
(Attempt to list directory before gfile is obtained!)