further fix for the type error on count() when doing keyword filtering search