handle exit/entry actions