Detach sharedevent properly

Added missing parameter when detaching shared event.