add trail mode framework