count and offset are now working correctly