Solved bug in activity assignment