fix #67, we would reset tripIndex to pre-defined one when onEnd