Check if value is string before doing match