add pattend mode