keep the order of patterns