finally fixed the model hook for the files route thanks to @ahaurw01