Fixed bug in file upload