fix bug: find valiable pattern