Fixing randomise bug