add check if fileInfo is array or object