Updated random query to work