fixed bug that caused track end event to be to early