Closes program after pattern found?