Add wait for activity.

Fix #332
Merge pull request #334 from bootstraponline/wait_for_act

Add wait for activity.