pattern bug fixed