fix regexp tp prevent failure if map is at the very end