fixed issue where sample code return empty results