Added count method to tablegateway