add remainingTime function , connect to chanin server