do not compute gradient twice