updated with asOfDate qurey