Fix sqla total count

Fix #78