it seems endTask to work