Merge changes I5c414d67,I83d74c94 into nyc-dev

* changes:
  Just return the task to the pool if it is not in the current stack.
  Refactoring to update stack in onResume.