fix pattern match to array