fix last fid handling