small fix to matched last. 

changed a bug in the last matched code