adding onTermonate callback