added delay to check session's streams timeouts, and sleep function replaced by poll