bug fix by adding return value for takeActivity func