implement populate + fix bug