Task scheduler bug fixed