fixed calculation of next episode