Fix rate limiting and callback logic