move uid query to another controller