getindex override for Derivative