Fixed file storage issue, where returned file is empty