add method to reset test and fix bug with random