fix for rand