handle failure in derivatives when counts=0