Replace count with exists

Because ```count``` is slower (on PostgreSQL for example)