Add function to get a random object