correcting a bug in randomized commands