fix logical pattern conversion bug