improved stm
removed bug in repeated task