fixed small bug when using random tagging