Changed $timeout to $interval for keepAlive