Fix file passing bug