Edit populate function