pattern bug fix