added call to close add the end of the random test function