Fixed stack overflow exception

Fixed stack overflow exception when running longer then 12 minutes!