bug fix in trail