Adding optional match to query builder