Added restriction for activity recognition

Closes #1608