added rate limit checking