added redirection to next task at the end of encounter