Add register_activity function