fix missing onEnded callback binding