fixed the problem with sampling time