Fixed a bug with activities