Use waitForActivity instead of getLastActivity as suggested by issue-586