Added code for limited amount of membership queries.