fix client-side pattern matching