fix bug in random when passing negative values