Fix file upload bug