fixed bug w/ having empty output whn usng patterns