Along with this change you can remove the 2nd clause for terminate since this one will always match.