populate_resultset helper function added