working on activity loop