Fix sqla total count