fixed some recursive patterns