fix onEnded