fix bug pattern_id