made gradient test deterministic