Why do we need the sid here? Passing it to register_before_send wouldn't be enough?