updated code in events and activities models