prevent n+1 query by using is_master