Fix the query to retrieve files by user.