refactored leave_hub method