fixed case of p1 using activity table name instead of tid