Fixed a bug where cache value would be checked in the has method, rather than returning true.
Updated the query in has method to count results rather than returning the results.