empty pattern bug fix