bug fixed (random output)