add random gradient check