Add timeout to the leave function to give enough time for the unsubsribe function finish