Add check for empty match
Fix return