better error and rate limiting