Fix match index

When I tried to install the project locally m['mid'] did not exists so I used the each index instead.