fixed bugs in random melody