move changes from setSelectionAsFindPattern to attach